const cloud = require('wx-server-sdk');

cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV,
});

const db = cloud.database();
const COLLECTION = 'account';

// 获取openId云函数入口函数
exports.main = async (event, context) => {
  const { ms } = event;
  const query = {
    _id: "test1",
  };
    query.pwd = "123";
    const ps = [
      db.collection(COLLECTION).where(query).get(),
      db.collection(COLLECTION).doc("test2").get()
    ]
  const res = await Promise.all(ps)
    return {res}
  return new Promise(rs => setTimeout(() => rs(res), ms))
};
